﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Krilib.Bridges
{
    public interface ICommonOperation
    {
        /// <summary>
        /// XML serialize wrapper
        /// </summary>
        /// <typeparam name="Type">Serialize type</typeparam>
        /// <param name="obj">Serialize target's instance</param>
        /// <param name="path">Destination path</param>
        void XMLSave<Type>(Type obj, string path);

        /// <summary>
        /// XML deserialize wrapper
        /// </summary>
        /// <typeparam name="Type">Deserialize type</typeparam>
        /// <param name="path">Origin path</param>
        /// <returns>Deserialized instance</returns>
        Type XMLLoad<Type>(string path);

        /// <summary>
        /// Crypto string with AES
        /// </summary>
        /// <param name="source">Raw string</param>
        /// <returns>Crypted string</returns>
        string AESEncrypt(string source);

        /// <summary>
        /// Decrypto crypted-string with AES
        /// </summary>
        /// <param name="cryptograph">Crypted string</param>
        /// <returns>Raw string</returns>
        string AESDecrypt(string cryptograph);

        /// <summary>
        /// Call default web browser with URI
        /// </summary>
        /// <param name="uri">Navigation uri</param>
        void CallBrowser(Uri uri);

        /// <summary>
        /// Set timeline-list's cursor
        /// </summary>
        /// <param name="cursor">Set cursor resource</param>
        void SetCursor(System.Windows.Forms.Cursor cursor);

        /// <summary>
        /// Edit searchdata with GUI
        /// </summary>
        /// <param name="cluster">base cluster</param>
        /// <returns>new cluster</returns>
        Data.SearchDataCluster ConfigSearchData(Data.SearchDataCluster cluster);
    }
}
